﻿<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>宇甲 新年快乐！</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<style type="text/css">
		@font-face {
			font-family: digit;
			src: url('static/digital-7_mono.ttf') format("truetype");
		}
	</style>
	<link href="../style/default.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="../style/jquery.js"></script>
	<script type="text/javascript" src="../style/garden.js"></script>
	<script type="text/javascript" src="../style/functions.js"></script>
</head>

<body>
<audio src="../js/liyujia.mp3" id="bgmusic" autoplay="autoplay" loop="loop">
</audio>
<!--<audio src="liyujia.mp3"></audio>-->
<div id="mainDiv">
	<div id="content">
		<div id="code">
			<span class="space" /><span class="comments">这一年的故事很简单，遇见你我很喜欢</span><br />
			<span class="space" /><span class="comments">喜欢 大概是这个世上 最独断最没有道理的事了</span><br />
			<span class="space" /><span class="comments">不是权衡利弊，不是见色起意                </span><br />
			<span class="space" /><span class="comments">而是突然间有了一个你 让我牵肠挂肚         </span><br />
			<span class="space" /><span class="comments">你是我安稳岁月里的节外生枝                </span><br />
			<span class="space" /><span class="comments">是我平淡生活里的日月星辰                  </span><br />

			<span class="space" /><span class="comments">何其幸运遇见你，                          </span><br />
			<span class="space" /><span class="comments">当你走进我心理的那一刻，                  </span><br />
			<span class="space" /><span class="comments">就没人能替代你                            </span><br />
			<span class="space" /><span class="comments">愿你年年有我，愿我岁岁有你！              </span><br />
			<span class="space" /><span class="comments">新年快乐！                                 </span><br />

			<script type="text/javascript">

				google_ad_client = "ca-pub-3712320065678109";
				/* lovead */
				google_ad_slot = "0650322805";
				google_ad_width = 320;
				google_ad_height = 50;
				//-->
			</script>
			<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
			</script>
		</div>
		<div id="loveHeart">
			<canvas id="garden"></canvas>
			<div id="words">
				<div id="messages">
					<center>
						<script type="text/javascript">
							<!--
							google_ad_client = "ca-pub-3712320065678109";
							/* lovead */
							google_ad_slot = "0650322805";
							google_ad_width = 320;
							google_ad_height = 50;
							-->
						</script>
						<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
						</script>
					</center>
					yujia, I will have fallen in love with you for
					<div id="elapseClock" style="display:none"></div><br>
					<a href='#' id="accept" >click me if accept me</a>
				</div>
				<div id="loveu">
					Love u forever and ever.<br/>
					<div class="signature">- asheng</div>
				</div>
			</div>
		</div>
	</div>

</div>
<script src="../js/vue.js"></script>
<script src="plugins/elementui/index.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script type="text/javascript">
	//添加侦听时间，DOM加载完后执行。
	document.addEventListener('DOMContentLoaded', function() {
		function audioAutoPlay() {
			var bgmusic = document.getElementById('bgmusic');
			bgmusic.play();
			//侦听微信ready事件。
			document.addEventListener("WeixinJSBridgeReady", function() {
				bgmusic.play();
			}, false);
		}
		audioAutoPlay();
	});

	var offsetX = $("#loveHeart").width() / 2;
	var offsetY = $("#loveHeart").height() / 2 - 55;

	if(!document.createElement('canvas').getContext) {
		var msg = document.createElement("div");
		msg.id = "errorMsg";
		msg.innerHTML = "Your browser doesn't support HTML5!<br/>Recommend use Chrome 14+/IE 9+/Firefox 7+/Safari 4+";
		document.body.appendChild(msg);
		$("#code").css("display", "none")
		$("#copyright").css("position", "absolute");
		$("#copyright").css("bottom", "10px");
		document.execCommand("stop");
	} else {
		setTimeout(function() {
			adjustWordsPosition();
			startHeartAnimation();
		}, 10000);

		$("#accept").click(function() {
			var together = new Date();
			console.log(together)
			axios.get(`/books/${together}`).then((res) => {
				console.log(res.data);
				together = res.data;
			});
			$(this).hide();
			$("#elapseClock").show();



			timeElapse(together);
			setInterval(function() {
				timeElapse(together);
			}, 500);
		})
		adjustCodePosition();
		$("#code").typewriter();
	}
</script>
</body>

</html>